# 定义一个列表
list = []
for i in range(1,11):
    list.append(i)
print(list)


# 用列表推导式
list1 = [i for i in range(1,11)]
print(list1)

# 求立方
list2 = [i**3 for i in range(1,11)]
print(list2)

# 字符串的拼接
list3 = ["hello" + str(i) for i in range(1,11)]
print(list3)

# 100以内的奇数
list4 = [i for i in range(1,101,2)]
print(list4)

# 100 以内奇数
list5 = [i for i in range(1,101)if i % 2 !=0]
print(list5)

# [1,2,3,4,5,....100]变成[[1,2,3],[4,5,6]]
list6 = [i for i in range(1,101)]
for i in range(0,len(list6),3):
    print(list6[i:i+3])